package edu.yngsxy.communityservice.sys.model.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import edu.yngsxy.communityservice.core.model.entity.WkBaseEntity;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.io.Serializable;
import jakarta.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
/**
 * <p>
 * 权限：存储系统所有用户的基础信息
 * </p>
 *
 * @author lr
 * @since 2025-09-09
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName("sys_permission")
@Schema(description = "权限：存储系统所有用户的基础信息")
public class SysPermission extends WkBaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 权限名称：是给人看的“文章增加”
     */
    @TableField("name")
    @Schema(title = "权限名称", description = "是给人看的“文章增加”", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "权限名称不能为空")
    @Size(max = 50, message = "权限名称长度不能超过50个字符")
    private String name;

    /**
     * 权限码：给电脑程序看的如“article_add”）
     */
    @TableField("code")
    @Schema(title = "权限码", description = "给电脑程序看的如“article_add”）", requiredMode =Schema.RequiredMode.REQUIRED)
    @NotBlank(message = "权限码不能为空")
    @Size(max = 50, message = "权限码长度不能超过50个字符")
    private String code;

    /**
     * 权限URL：该权限操作的地址如“/article_add.do”
     */
    @TableField("url")
    @Schema(title = "权限URL", description = "该权限操作的地址如“/article_add.do”", requiredMode =Schema.RequiredMode.NOT_REQUIRED)
    @Size(max = 255, message = "权限URL长度不能超过255个字符")
    private String url;
}
